/*
 *  Copyright 2004 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.webapp.taglib.core.grid.util;

/**
 * <p>Contains filter-specific constants</p>
 * There are several group of filter conditions presented in this class<br />
 * <b>Conditions applicable to all filter types</b>:
 * <ul type="disc">
 * <li><em>OBJECT_IS_NULL</em> - indicates that field associated with this filter must be a NULL</li>
 * <li><em>OBJECT_IS_NOT_NULL</em> - indicates that field associated with this filter must not be a NULL</li>
 * </ul>
 * <br />
 * <b>Conditions applicable to date filter</b>:
 * <ul type="disc">
 * <li><em>DATE_BEFORE</em> - indicates that value of field associated with this filter must be before specified date</li>
 * <li><em>DATE_EQUAL</em> - indicates that value of field associated with this filter must be equal to the specified date</li>
 * <li><em>DATE_NOT_EQUAL</em> - indicates that value of field associated with this filter must not be equal to the specified date</li>
 * <li><em>DATE_AFTER</em> - indicates that value of field associated with this filter must be after specified date</li>
 * </ul>
 * <br />
 * <b>Conditions applicable to number filter</b>:
 * <ul type="disc">
 * <li><em>NUMBER_LESS_THAN</em> - indicates that value of field associated with this filter must be less than specified number</li>
 * <li><em>NUMBER_LESS_OR_EQUAL</em> - indicates that value of field associated with this filter must be less than or equal to the specified number</li>
 * <li><em>NUMBER_EQUAL</em> - indicates that value of field associated with this filter must be equal to the specified number</li>
 * <li><em>NUMBER_NOT_EQUAL</em> - indicates that value of field associated with this filter must not be equal to the specified date</li>
 * <li><em>NUMBER_GREATER_OR_EQUAL</em> - indicates that value of field associated with this filter must be greater than or equal to the specified number</li>
 * <li><em>NUMBER_GREATER_THAN</em> - indicates that value of field associated with this filter must be greater than specified number</li>
 * </ul>
 * <br />
 * <b>Conditions applicable to set filter</b>:
 * <ul type="disc">
 * <li><em>FIELD_IN_SET</em> - indicates that value of field associated with this filter must be contained in the specified set</li>
 * <li><em>FIELD_NOT_IN_SET</em> - indicates that value of field associated with this filter must not be contained in the specified set</li>
 * </ul>
 * <br />
 * <b>Conditions applicable to string filter</b>
 * <ul type="disc">
 * <li><em>STRING_STARTS_WITH</em> - indicates that value of field associated with this filter must start from the specified string</li>
 * <li><em>STRING_CONTAINS</em> - indicates that value of field associated with this filter must contain the specified string</li>
 * <li><em>STRING_EQUAL</em> - indicates that value of field associated with this filter must be lexicographically equal to the specified string</li>
 * <li><em>STRING_NOT_EQUAL</em> - indicates that value of field associated with this filter must not be lexicographically equal to specified string</li>
 * <li><em>STRING_ENDS_WITH</em> - indicates that value of field associated with this filter must end with specified string</li>
 * </ul>
 * <p><a href="FilterConditions.java.html"><i>View Source</i></a></p>
 * <p/>
 *
 * @author Sergey Zubtsovskiy <a href="mailto:sergey.zubtsovskiy@blandware.com">&lt;sergey.zubtsovskiy@blandware.com&gt;</a>
 * @version $Revision: 1.4 $ $Date: 2006/08/03 10:08:22 $
 */
public class FilterConditions {

	// Common contants

	/**
	 * Indicates that condition was not specified
	 */
	public static final String CONDITION_NOT_SET = "-";


	public static final String LOGIC_COPULA_AND = "and";
	public static final String LOGIC_COPULA_OR = "or";
	public static final String OBJECT_IS_NULL = "is null";
	public static final String OBJECT_IS_NOT_NULL = "is not null";

	// Date filter contants
	public static final String DATE_BEFORE = "<";
	public static final String DATE_EQUAL = "=";
	public static final String DATE_NOT_EQUAL = "<>";
	public static final String DATE_AFTER = ">";

	// Number filter constants
	public static final String NUMBER_LESS_THAN = "<";
	public static final String NUMBER_LESS_OR_EQUAL = "<=";
	public static final String NUMBER_EQUAL = "=";
	public static final String NUMBER_NOT_EQUAL = "<>";
	public static final String NUMBER_GREATER_OR_EQUAL = ">=";
	public static final String NUMBER_GREATER_THAN = ">";

	// Set filter constants
	public static final String FIELD_IN_SET = "in";
	public static final String FIELD_NOT_IN_SET = "not in";

	// String filter constants
	public static final String STRING_STARTS_WITH = "like '{0}%'";
	public static final String STRING_CONTAINS = "like '%{0}%'";
	public static final String STRING_EQUAL = "= '{0}'";
	public static final String STRING_NOT_EQUAL = "<> '{0}'";
	public static final String STRING_ENDS_WITH = "like '%{0}'";

}
